package com.itheima.TestEmployee;

public class TestE {
    public static void main(String[] args) {
        Employee[] e = new Employee[5];
        Employee employee1 = new Employee(12, Integer.parseInt("001"));
        Employee employee2 = new Employee(15, Integer.parseInt("003"));
        Employee employee3 = new Employee(166, Integer.parseInt("005"));
        Employee employee4 = new Employee(16, Integer.parseInt("006"));
        Employee employee5 = new Employee(1555, Integer.parseInt("0088"));

        e[0] = employee1;
        e[1] = employee2;
        e[2] = employee3;
        e[3] = employee4;
        e[4] = employee5;

        for (int i = 0; i < e.length; i++) {
            System.out.print(e[i] + ",");
        }

        System.out.println("\n");
        exchange(e);

        for (int i = 0; i < e.length; i++) {
            System.out.print(e[i] + ",");
        }
    }

    public static void exchange(Employee[] e) {
        int min = 0;
        int max = e.length - 1;
        for (; min <= max; min++, max--) {
            Employee t = e[min];
            e[min] = e[max];
            e[max] = t;
        }
    }
}
